<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
	</body>
	<script>
		//189000416 杨文深
		let line = prompt("请输入行数：");
	
        //三角形
		for(let i = 1; i <= line; i++){
		    for(let j = 1; j <= line - i; j++){
		        document.write("&nbsp;");
		    }
		    for(let m = 1; m <= 2 * i - 1; m++){
				if (m % 2 != 0)
					document.write("*");
				else
					document.write("&nbsp;");
		    }
			document.write("<br/>");
		}

        //平行四边形
		for (let i = line; i > 0; i--) {
			for (let j = 1; j <= i - 1; j++) {
				document.write("&nbsp;");
			}
			for (let k = 1; k <= line; k++) {
					document.write("*");
			}
			document.write("<br/>");
		}
		
		//菱形
		let max = line;
		for (let i = 1; i <= max; i += 2) {
			for (let j = 1; j <= max - i; j++) {
				document.write("&nbsp;");
			}
			for (let m = 1; m <= 2 * i - 1; m++) {
				if (m % 2 != 0)
					document.write("*");
				else
					document.write("&nbsp;");
			}
			document.write("<br/>");
		}
		for (let i = max - 2; i >= 0; i -= 2) {
			for (let j = 1; j <= max - i; j++) {
				document.write("&nbsp;");
			}
			for (let m = 1; m <= 2 * i - 1; m++) {
				if (m % 2 != 0)
					document.write("*");
				else
					document.write("&nbsp;");
			}
			document.write("<br/>");
		}
		
	</script>
<html>
</body>
</html>